﻿/***********************************************************************
 * <copyright file="MainRibbonForm.cs" company="Linh Khang">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Author:   LinhMC
 * Email:    linhmc.vn@gmail.com
 * Website:
 * Create Date: Sunday, February 09, 2014
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/

using System;
using System.Drawing;
using System.Windows.Forms;
//using WindowsForms.AOnline.Report.MainReport;
using WindowsForms.AOnline.Report.MainReport;
using WindowsForms.AOnline.WindowsForm.CommonClass;
using WindowsForms.AOnline.WindowsForm.FormDictionary;
using WindowsForms.AOnline.WindowsForm.UserControl.DiagramDesktop;

using DevExpress.XtraBars;
using DevExpress.XtraEditors;
using DevExpress.XtraNavBar;
using WindowsForms.AOnline.WindowsForm.UserControl.Dictionary;
using WindowsForms.AOnline.WindowsForm.UserControl.Voucher;


namespace WindowsForms.AOnline.WindowsForm
{
    /// <summary>
    /// Main form application
    /// </summary>
    public partial class MainRibbonForm : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MainRibbonForm"/> class.
        /// </summary>
        public MainRibbonForm()
        {
            InitializeComponent();
            CommonFunction.CommonUserControl = new XtraUserControl();
        }

        /// <summary>
        /// Handles the ItemClick event of the ribbonMainMenu control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ItemClickEventArgs"/> instance containing the event data.</param>
        private void ribbonMainMenu_ItemClick(object sender, ItemClickEventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            switch (e.Item.Name)
            {
                case "barButtonItem27":  //DDown vij
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlOutputInventoryList))
                    {
                        var userControl = new UserControlOutputInventoryList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = @"Chứng từ xuất kho";// Resources.ResourceHelper.GetResourceValueByName("ResAccountCaption");
                    }
                    break;

                case "barUnit":  //DDown vij   
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlUnitList))
                    {
                        var userControl = new UserControlUnitList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResAccountCaption");
                    }
                    break;
                case "barNguoiDung":  //DDown vij
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlUnitList))
                    {
                        var userControl = new UserControlUnitList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResAccountCaption");
                    }
                    break;

                case "barButtonAccountItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlAccountList))
                    {
                        var userControl = new UserControlAccountList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResAccountCaption");
                    }
                    break;
                case "barVendor":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlVendorList))
                    {
                        var userControl = new UserControlVendorList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResVendor");
                    }
                    break;
                case "barCustomers":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlCustomerList))
                    {
                        var userControl = new UserControlCustomerList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResSalaryListCaption");
                    }
                    break;
               //Phòng ban
                case "barCapitalAllocateItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlDepartmentList))
                    {
                        var userControl = new UserControlDepartmentList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResCapitalAllocateCaption");
                    }
                    break;
                case "barInputInventory":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlInputInventoryList))
                    {
                        var userControl = new UserControlInputInventoryList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = @"Chứng từ nhập kho";// Resources.ResourceHelper.GetResourceValueByName("Chứng từ nhập kho");
                    }
                    break;
                case "barButtonStock":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlStockList))
                    {
                        var userControl = new UserControlStockList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResStockCaption");
                    }
                    break;
                case "barButtonInventoryItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlInventoryItemList))
                    {
                        var userControl = new UserControlInventoryItemList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResInventoryItemCaption");
                    }
                    break;
                case "barButtonDbOption":
                    var frmXtraFormDbOption = new FrmXtraDBOption();
                    frmXtraFormDbOption.ShowDialog();
                    break;
                case "barButtonAutoBusiness":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlAutoBusinessList))
                    {
                        var userControl = new UserControlAutoBusinessList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResAutoBusinessCaption");
                    }
                    break;
                //case "barCurrencyItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlCurrencyList))
                //    {
                //        var userControl = new UserControlCurrencyList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResCurrencyCaption");
                //    }
                //    break;
             
                //case "barButtonReceiptItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlReceiptEstimateList))
                //    {
                //        var userControl = new UserControlVoucherReceiptList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResCashReceiptCaption");
                //    }
                //    break;
                //case "barButtonPlaymentItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlReceiptEstimateList))
                //    {
                //        var userControl = new UserControlPaymentEstimateList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResCashReceiptCaption");
                //    }

                //    break;
                //case "barButtonDepartment":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlDepartmentList))
                //    {
                //        var userControl = new UserControlDepartmentList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResDepartmentCaption");
                //    }
                //    break;
                case "barButtonFixedAssetCategoryItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlFixedAssetCategoryList))
                    {
                        var userControl = new UserControlFixedAssetCategoryList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResFixedAssetCategoryCaption");
                    }
                    break;
                case "barButtonFixedAssetItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlFixedAssetList))
                    {
                        var userControl = new UserControlFixedAssetList { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResFixedAssetCaption");
                    }
                    break;
                //case "barBudgetItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlBudgetItemList))
                //    {
                //        var userControl = new UserControlBudgetItemList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResBudgetItemCaption");
                //    }
                //    break;
                //case "barButtonPayItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlPayItemList))
                //    {
                //        var userControl = new UserControlPayItemList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResPayItemCaption");
                //    }
                //    break;
                //case "barButtonAccountCategory":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlAccountCategoryList))
                //    {
                //        var userControl = new UserControlAccountCategoryList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResAccountCategoryCaption");
                //    }
                //    break;
                //case "barCustomers":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlCustomerList))
                //    {
                //        var userControl = new UserControlCustomerList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResCustomer");
                //    }
                //    break;
             
                //case "barAccountingObject":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlAccountingObjectList))
                //    {
                //        var userControl = new UserControlAccountingObjectList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResAccountingObject");
                //    }
                //    break;
                //case "barVoucherList":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlVoucherList))
                //    {
                //        var userControl = new UserControlVoucherList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResVoucherList");
                //    }
                //    break;
                //case "barButtonBudgetChapter":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlBudgetChapterList))
                //    {
                //        var userControl = new UserControlBudgetChapterList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResBudgetChapterCaption");
                //    }
                //    break;
                //case "barButtonBudgetCategory":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlBudgetCategoryList))
                //    {
                //        var userControl = new UserControlBudgetCategoryList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResBudgetCategoryCaption");
                //    }
                //    break;
                //case "barMergerFundItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlMergerFundList))
                //    {
                //        var userControl = new UserControlMergerFundList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResMergerFundCaption");
                //    }
                //    break;
                //case "barButtonBudgetSource":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlBudgetSourceList))
                //    {
                //        var userControl = new UserControlBudgetSourceList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResBudgetSourceCaption");
                //    }
                //    break;
                //case "barButtonEmployee":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlEmployeeList))
                //    {
                //        var userControl = new UserControlEmployeeList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResEmployeeCaption");
                //    }
                //    break;
                //case "barPlanTemplate":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlBudgetSourceList))
                //    {
                //        var userControl = new UserControlPlanTemplateList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResPlanTemplateCaption");
                //    }
                //    break;
                
                //case "barButtonBank":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlBankList))
                //    {
                //        var userControl = new UserControlBankList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResBankCaption");
                //    }
                //    break;
                //case "barButtonPaymentItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlPaymentVoucherList))
                //    {
                //        var userControl = new UserControlPaymentVoucherList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResPaymentVoucher");
                //    }
                //    break;
                //case "barButtonAccountTranfer":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlAccountTranferList))
                //    {
                //        var userControl = new UserControlAccountTranferList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResAccountTranferCaption");
                //    }
                //    break;
                //case "barButtonAudittingLog":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlAudittingLogList))
                //    {
                //        var userControl = new UserControlAudittingLogList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResAudittingLogCaption");
                //    }
                //    break;
                //case "barButtonReceiptEstimateItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlReceiptEstimateList))
                //    {
                //        var userControl = new UserControlReceiptEstimateList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResReceiptEstimateCaption");
                //    }
                //    break;
                //case "barButtonPaymentEstimateItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlPaymentEstimateList))
                //    {
                //        var userControl = new UserControlPaymentEstimateList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResPaymentEstimateCaption");
                //    }
                //    break;
                //case "barButtonPaymentDepositItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlPaymentDepositList))
                //    {
                //        var userControl = new UserControlPaymentDepositList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResPaymentDepositCaption");
                //    }
                //    break;
                //case "barButtonReceiptDepositItem":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlReceiptDepositList))
                //    {
                //        var userControl = new UserControlReceiptDepositList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResReceiptDepositCaption");
                //    }
                //    break;
              
                //case "barButtonProject":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlProjectList))
                //    {
                //        var userControl = new UserControlProjectList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResProjectCaption");
                //    }
                //    break;
                
                //case "barButtonFAIncrement":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlFAIncrementList))
                //    {
                //        var userControl = new UserControlFAIncrementList{ Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResFixedAssetIncrementCaption");
                //    }
                //    break;
                //case "barButtonFADecrement":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlFADecrementList))
                //    {
                //        var userControl = new UserControlFADecrementList{ Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResFixedAssetDecrementCaption");
                //    }
                //    break;
                //case "barButtonFAArmortization":
                //    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlFAArmortizationList))
                //    {
                //        var userControl = new UserControlFAArmortizationList { Dock = DockStyle.Fill };
                //        CommonFunction.RunUserControl(userControl, panelMain);
                //        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResFixedAssetArmortizationCaption");
                //    }
                //    break;
               
                //case "barButtonPostedDate":
                //    var frmXtraPostedDate = new FrmXtraPostedDate();
                //    frmXtraPostedDate.ShowDialog();
                //    break;
                //case "barButtonDbInfo":
                //    var frmXtraDbInfo = new FrmXtraDbInfo();
                //    frmXtraDbInfo.ShowDialog();
                //    break;
            }
        }

        /// <summary>
        /// Handles the MouseDown event of the navBarMainLeft control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
        private void navBarMainLeft_MouseDown(object sender, MouseEventArgs e)
        {
            var navBar = sender as NavBarControl;
            if (navBar == null)
                return;
            var hitInfo = navBar.CalcHitInfo(new Point(e.X, e.Y));
            if (!hitInfo.InLink)
                return;
            switch (hitInfo.Link.ItemName)
            {
                case "navBarEstimateItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlEstimateDesktop))
                    {
                        var userControl = new UserControlEstimateDesktop { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResEstimateCaption");
                    }
                    break;
                case "navBarCashItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlCashDesktop))
                    {
                        var userControl = new UserControlCashDesktop { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResCashCaption");
                    }
                    break;
                case "navBarDepositItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlDepositDesktop))
                    {
                        var userControl = new UserControlDepositDesktop { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResDepositCaption");
                    }
                    break;
                case "navBarInventoryItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlInventoryDesktop))
                    {
                        var userControl = new UserControlInventoryDesktop { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResInventoryCaption");
                    }
                    break;
                case "navBarFixedAssetItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlFixedAssetDesktop))
                    {
                        var userControl = new UserControlFixedAssetDesktop { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResFixedAssetCaption");
                    }
                    break;
                case "navBarSalaryItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlSalaryDesktop))
                    {
                        var userControl = new UserControlSalaryDesktop { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResSalaryCaption");
                    }
                    break;
                case "navBarGeneralItem":
                    if (CommonFunction.CommonUserControl != null && CommonFunction.CommonUserControl.GetType() != typeof(UserControlGeneralDesktop))
                    {
                        var userControl = new UserControlGeneralDesktop { Dock = DockStyle.Fill };
                        CommonFunction.RunUserControl(userControl, panelMain);
                        FeatureCaption.Text = Resources.ResourceHelper.GetResourceValueByName("ResGeneralCaption");
                    }
                    break;
                case "navBarReportItem":
                    var frmXtraReport = new FrmReportList();
                    frmXtraReport.ShowDialog();
                    break;
                    
            }
        }
    }
}